//
//  MapViewController.swift
//  testRxSwift
//
//  Created by 火星人 on 2017/7/25.
//  Copyright © 2017年 火星人. All rights reserved.
//

import UIKit
import RxSwift

class MapViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        self.view.addTapWithHandle { (tap) in
            
            let disBag = DisposeBag()
            
            Observable.of(1, 2, 3, 4)
                .map({ (value) -> Int in
                    if value % 2 == 0{
                        return value
                    }
                    return value * value
                })
                .subscribe({ (eve) in
                    print(eve)
                })
                .disposed(by: disBag)
        }
    }

}
